﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Windows.Input;

namespace KDGIPReporter
{
    class IPViewModel:INotifyPropertyChanged
    {
        private IPModel iPM;
        public IPViewModel ()
	{
            iPM = new IPModel();

	}

        #region Properties

        public IPModel IPM
        {
            get { return iPM; }
            set
            {
                iPM = value;
            }
        }

        public string PublicIP
        {
            get { return IPM.PublicIP; }
            set
            {
                IPM.PublicIP = value;
                OnPropertyChanged("PublicIP");
            }
        }

        public string LocalIP
        {
            get { return IPM.LocalIP; }
            set
            {
                IPM.LocalIP = value;
                OnPropertyChanged("LocalIP");
            }
        }

        #endregion

        #region Commands

     /*   public bool CanExecute()
        {
            return true;
        }

        public void refresh()
        {
            IPM.getLocalIP();
            IPM.getPublicIP();

        }

        public ICommand RefreshCommand
        {
            get { return new Command(CanExecute, refresh); }
        }*/
        #endregion


        public event PropertyChangedEventHandler PropertyChanged;

        private void OnPropertyChanged(string property)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(property));

            }
        }
    }
}
